@extends('admin.public')

@section('content')
    @if( (bool)\Auth::guard('admin')->user()->is_root )
        <div class="col-md-12">
            <section class="panel panel-default text-sm doc-buttons">
                <div class="panel-body">
                    <a href="{{ route('admin.banner.label_add') }}" class="btn btn-info"><i class="icon-plus ico"></i>
                        &nbsp; 添加标签</a>
                </div>
            </section>
        </div>
    @endif

    <div class="col-md-12">
        <section class="panel panel-default">
            <header class="panel-heading">
                {{ $frame['title'] }}
            </header>
            <table class="table table-striped m-b-none">
                <thead>
                <tr>
                    <th class="col-md-4">名称</th>
                    <th class="col-md-4">调用标签</th>
                    <th class="col-md-4">操作</th>
                </tr>
                </thead>
                <tbody>
                @if(!empty($bannerLabels))
                    @foreach( $bannerLabels as $label)
                        <tr>
                            <td>
                                <a href="{{ route('admin.banner.label') }}?change=status&id={{ $label->id }}"
                                   class="m-r">
                                    @if( (bool)$label->status )
                                        <i class="fa-tags fa text-xs text-ff552e text-center-xs" title="Banner标签开启"></i>
                                    @else
                                        <i class="fa-tags fa text-xs text-no text-center-xs" title="Banner标签关闭"></i>
                                    @endif
                                </a>
                                {{ $label->name }}
                            </td>
                            <td>{{ '{' }}{ $banners['{{ $label->path }}'] }}</td>
                            <td>
                                <a href="{{ route('admin.banner.banner_add',$label->id) }}"
                                   class="btn btn-xs btn-default">添加图片</a>
                                <a href="{{ route('admin.banner.label_edit',$label->id) }}"
                                   class="btn btn-xs btn-default">编辑</a>
                                <a href="{{ route('admin.banner.label') }}?del={{ $label->id }}"
                                   class="btn btn-xs btn-danger">删除</a>
                            </td>
                        </tr>
                    @endforeach
                @else
                    <tr>
                        <td colspan="3" align="center">
                            暂无Banner标签,请
                            <a href="{{ route('admin.banner.label') }}" class="text-info">添加标签</a>!
                        </td>
                    </tr>
                @endif
                </tbody>
            </table>
        </section>
    </div>
@endsection

@section('css')
@endsection

@section('js')
@endsection